﻿using System;

namespace diantou.dataModel
{
    /// <summary>
    /// 收藏夹
    /// </summary>
    [fastCSharp.emit.jsonSerialize(IsAllMember = true)]
    [fastCSharp.emit.jsonParse(IsAllMember = true)]
    [fastCSharp.emit.dataSerialize(IsReferenceMember = false)]
    [fastCSharp.code.cSharp.webView.clientType(Name = "diantou.favorite")]
    [fastCSharp.code.cSharp.sqlModel(LogTcpCallService = "DataLog")]
    public partial class favorite
    {
        /// <summary>
        /// 收藏夹标识
        /// </summary>
        [fastCSharp.code.cSharp.webView.outputAjax]
        public int Id;
        /// <summary>
        /// 用户标识
        /// </summary>
        public int UserId;
        /// <summary>
        /// 收藏夹名称
        /// </summary>
        [fastCSharp.emit.dataMember(MaxStringLength = 32)]
        public string Name;
        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateTime = fastCSharp.date.NowSecond;
        /// <summary>
        /// 图片
        /// </summary>
        [fastCSharp.emit.dataMember(IsAscii = true, MaxStringLength = 64)]
        public sqlMember.image Icon = string.Empty;
        /// <summary>
        /// 评论数量
        /// </summary>
        public int CommentCount;
        /// <summary>
        /// 收藏类型
        /// </summary>
        public enum type : byte
        {
            /// <summary>
            /// 答案
            /// </summary>
            Answer = 0,
            /// <summary>
            /// 问题
            /// </summary>
            Question = 1,
            /// <summary>
            /// 话题
            /// </summary>
            Topic = 2,
            /// <summary>
            /// 用户
            /// </summary>
            User = 3,
            /// <summary>
            /// 收藏
            /// </summary>
            Favorite = 4,
            /// <summary>
            /// OJ问题
            /// </summary>
            Problem = 5,
            /// <summary>
            /// 比赛
            /// </summary>
            Contest = 6,
        }
        [fastCSharp.emit.dataMember(DataType = typeof(byte))]
        public type Type;
        /// <summary>
        /// 隐私类型
        /// </summary>
        [fastCSharp.emit.dataMember(DataType = typeof(byte))]
        public privacy Privacy = privacy.AllUser;

        /// <summary>
        /// 收藏夹描述
        /// </summary>
        [fastCSharp.emit.dataMember(Group = 1, MaxStringLength = 64 << 10)]
        public string Remark = string.Empty;

        /// <summary>
        /// 关注者数量
        /// </summary>
        [fastCSharp.emit.dataMember(IsIgnoreCurrent = true, IsSqlStream = true)]
        public int FocusCount;
        ///// <summary>
        ///// 被收藏次数
        ///// </summary>
        //[fastCSharp.emit.dataMember(IsIgnoreCurrent = true)]
        //public int FavoriteCount;
        /// <summary>
        /// 收藏数量
        /// </summary>
        [fastCSharp.emit.dataMember(IsIgnoreCurrent = true, IsSqlStream = true)]
        public int LinkCount;
    }
}
